package com.yuanfengPlus.incomeitem.controller;


import com.yuanfengPlus.incomeitem.model.IncomeItemInfo;
import com.yuanfengPlus.incomeitem.service.impl.IncomeItemServiceImpl;
import com.yuanfengPlus.utils.PageResult;
import com.yuanfengPlus.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@CrossOrigin
@RequestMapping("/incomeitem")
@Api(tags = "收入项目管理")
public class IncomeItemController {
    @Resource
    private IncomeItemServiceImpl iiso;
    @PostMapping("/insert")
    @ApiOperation("添加收入项目信息")
    public Result<String> insert(@RequestBody IncomeItemInfo incomeItemInfo) {
        return iiso.insert(incomeItemInfo);
    }
    @PostMapping("/update")
    @ApiOperation("修改收入项目信息")
    public Result<String> update(@RequestBody IncomeItemInfo incomeItemInfo) {
        return iiso.update(incomeItemInfo);
    }
    @PostMapping("/select")
    @ApiOperation("查询收入项目信息")
    public Result<PageResult> select(@RequestBody Map<String, Object> params) {
        return Result.success(iiso.select(params));
    }
}
